package cn.iocoder.yudao.module.forward.dal.mysql.scope;

import java.util.*;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.forward.dal.dataobject.scope.ScopeInfo;
import cn.iocoder.yudao.module.forward.dal.dataobject.scope.ScopeResourceDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 授权范围信源关联 Mapper
 *
 * @author zhang
 */
@Mapper
public interface ScopeResourceMapper extends BaseMapperX<ScopeResourceDO> {

    default List<ScopeResourceDO> selectListByScopeId(Integer scopeId) {
        return selectList(ScopeResourceDO::getScopeId, scopeId);
    }

    default int deleteByScopeId(Integer scopeId) {
        return delete(ScopeResourceDO::getScopeId, scopeId);
    }

    List<ScopeInfo> selectScopeInfos(@Param(Constants.WRAPPER) QueryWrapper<ScopeInfo> wrapper);
//    List<ScopeInfo> selectScopeInfos(Integer resourceId, String scopeType);
}
